package com.itheima.health.job;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.health.service.OrderSettingService;

import java.text.SimpleDateFormat;
import java.util.Date;

public class ClearOutOrderData {
    @Reference
   private OrderSettingService orderSettingService;

    //清理预约历史数据
    public void clearOrderData() {
        Date date = new Date();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        String clearTime = format.format(date);
        System.out.println("清理进行中...");
        orderSettingService.ClearOutOrderData(clearTime);
        System.out.println("清理完成！");
    }
}
